home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Database How-To
/
Visual Basic 4 Database - How-to (The Waite Group)(1995).iso
/
editing.cl_
/
editing.cl
Wrap
Text File
|
1995-07-20
|
2KB
|
78 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = 0 'False
END
Attribute VB_Name = "EditPublishers"
Attribute VB_Creatable = True
Attribute VB_Exposed = True
Option Explicit
'Declare the variables that will hold the class's Properties
Public FilePathName As String
Private ConnectString As String
Public TableName As String
'Data access objects for getting information about the Recordset
Private db As DATABASE
Private rs As Recordset
Public Property Get Connection() As String
Connection = ConnectString
End Property
Public Property Get Height()
Height = frmEdit.Height
End Property
Public Sub Move(formLeft As Integer, formTop As Integer)
'When the form is a child of another window, all
'measurements are relative to that parent window,
'so all we need to do is set the position
frmEdit.Move formLeft, formTop
End Sub
Public Property Get NumRecords() As Integer
rs.MoveLast
NumRecords = rs.RecordCount
rs.MoveFirst
End Property
Public Sub SetOnForm(parentHwnd As Variant)
Dim prevParent As Variant
prevParent = SetParent(frmEdit.hWnd, parentHwnd)
frmEdit.Show
End Sub
Public Property Get Width()
Width = frmEdit.Width
End Property
Private Sub Class_Initialize()
'Make a connection to the database for accessing
'other parameters
frmEdit.Hide
Set db = OpenDatabase(frmEdit.dataTitles.DatabaseName)
Set rs = db.OpenRecordset(frmEdit.dataTitles.RecordSource, dbOpenSnapshot)
FilePathName = frmEdit.dataTitles.DatabaseName
ConnectString = db.Connect
TableName = frmEdit.dataTitles.RecordSource
End Sub
Private Sub Class_Terminate()
Set db = Nothing
Set rs = Nothing
End Sub